package com.hzau.tourist_service_sys.config;

import com.hzau.tourist_service_sys.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Arrays;
@Slf4j
@Component
@Aspect
public class ParamAop {
    @Around("execution(* com.hzau.tourist_service_sys.service.impl.*.*(..))")
    public Object Paramsout(ProceedingJoinPoint joinPoint)throws Throwable{
        Object[] args = joinPoint.getArgs();
        log.info(Arrays.toString(args));
        log.info(joinPoint.getSignature().getName());
        Object res=joinPoint.proceed();
        if(res!=null)
        log.info(res.toString());
        else log.info("res is null");
        return res;
    }
}
